package com.yuyou.train.admin.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.train.admin.mapper.AuthRoleResourceRelationMapper;
import com.yuyou.train.admin.service.IAuthRoleResourceRelationService;
import com.yuyou.train.service.api.admin.entity.AuthRoleResourceRelation;

/**
 * Created by yujin.liu on 2018/1/23.
 */
@Service
public class AuthRoleResourceRelationServiceImpl implements IAuthRoleResourceRelationService{

    @Autowired
    private AuthRoleResourceRelationMapper authRoleResourceRelationMapper;

    @Override
    public List<AuthRoleResourceRelation> findRoleResourceRelationByAuthRoleId(String authRoleId) {

        List<AuthRoleResourceRelation> authRoleResourceRelationList = authRoleResourceRelationMapper.findRoleResourceRelationByAuthRoleId(authRoleId);
        return authRoleResourceRelationList;
    }

    @Override
    public int batchInsertRoleResourceRelation(List<AuthRoleResourceRelation> authRoleResourceRelationList) {
        return authRoleResourceRelationMapper.batchInsertRoleResourceRelation(authRoleResourceRelationList);
    }

    @Override
    public int deleteByAuthRoleId(String authRoleId){
        return authRoleResourceRelationMapper.deleteByAuthRoleId(authRoleId);
    }
}
